package com.blog.dao.frontpage;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.blog.dao.conn.BaseDao;
import com.blog.dao.conn.ParamSet;
/**
 * 前台主页面dao层
 * @author Administrator
 *
 */
import com.blog.dao.conn.RowDatas;
import com.blog.entity.ArticleEntity;
import com.blog.entity.TypesEntity;
public class IndexDao extends BaseDao{

	private RowDatas<TypesEntity> typesInfo = new RowDatas<TypesEntity>() {
		
		@Override
		public TypesEntity getRowData(ResultSet rs) throws SQLException {
			TypesEntity te = new TypesEntity();
			te.setTypes_id(rs.getInt("types_id"));
			te.setTypes_name(rs.getString("types_name"));
			te.setTypes_url(rs.getString("types_url"));
			return te;
		}
	};
	
	/**
	 * 查询首页所有分类
	 */
	public List<TypesEntity> getAllTypesInfo(){
		String sql="select * from tb_types";
		return queryList(sql,typesInfo);
	}
}
